home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibclean / bibclean.txt < prev    next >
Text File  |  1992-11-23  |  37KB  |  991 lines

  1.  
  2.  
  3.  
  4. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      bibclean - prettyprint and syntax check  BibTeX  and  Scribe
  10.      bibliography data base files
  11.  
  12. SYNOPSIS
  13.      bibclean [ -author ] [ -error-log filename ]
  14.               [ -help ] [ '-?' ]
  15.               [ -[no-]check-values ]
  16.               [ -[no-]delete-empty-fields ]
  17.               [ -[no-]file-position ]
  18.               [ -[no-]fix-initials ] [ -[no-]fix-names ]
  19.               [ -[no-]par-breaks ] [ -[no-]print-patterns ]
  20.               [ -[-no]read-init-files filename ]
  21.               [ -[no-]remove-OPT-prefixes ]
  22.               [ -[no-]scribe ] [ -[no-]trace-file-opening ]
  23.               [ -[no-]warnings ] [ -version ]
  24.               <infile or  bibfile1 bibfile2 bibfile3 ...
  25.               >outfile
  26.  
  27.      All options can be abbreviated to a unique leading prefix.
  28.  
  29.      An explicit file name of ``-'' represents standard input; it
  30.      is assumed if no input files are specified.
  31.  
  32.      On VAX VMS and IBM PC DOS, the leading ``-'' on option names
  33.      may be replaced by a slash, ``/''; however, the ``-'' option
  34.      prefix is always recognized.
  35.  
  36. DESCRIPTION
  37.      bibclean prettyprints input  BibTeX  files  to  stdout,  and
  38.      checks  the  brace  balance and bibliography entry syntax as
  39.      well.  It can be used to detect  problems  in  BibTeX  files
  40.      that  sometimes confuse even BibTeX itself, and importantly,
  41.      can be used to normalize the appearance  of  collections  of
  42.      BibTeX files.
  43.  
  44.      Here is a summary of the formatting actions:
  45.  
  46.      +  BibTeX items are formatted into  a  consistent  structure
  47.         with  one  key = "value" pair per line, and the initial @
  48.         and trailing right brace in column 1.
  49.  
  50.      +  Tabs are  expanded  into  blank  strings;  their  use  is
  51.         discouraged  because  they  inhibit  portability, and can
  52.         suffer corruption in electronic mail.
  53.  
  54.      +  Long string values are split at  a  blank  and  continued
  55.         onto the next line with leading indentation.
  56.  
  57.      +  A  single  blank  line  separates  adjacent  bibliography
  58.         entries.
  59.  
  60.  
  61.  
  62.  
  63. Version 2.05      Last change: 17 November 1992                 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  71.  
  72.  
  73.  
  74.      +  Text outside BibTeX entries is passed through verbatim.
  75.  
  76.      +  Outer parentheses around entries are converted to braces.
  77.  
  78.      +  Personal names in author and editor field values are nor-
  79.         malized  to  the  form  ``P. D. Q.  Bach'', from ``P.D.Q.
  80.         Bach'' and ``Bach, P.D.Q.''.
  81.  
  82.      +  Hyphen sequences in page numbers  are  converted  to  en-
  83.         dashes.
  84.  
  85.      +  Month values are  converted  to  standard  BibTeX  string
  86.         abbreviations.
  87.  
  88.      +  In titles, sequences of upper-case  characters  at  brace
  89.         level  zero  are  braced  to protect them from being con-
  90.         verted to lower-case letters by some bibliography styles.
  91.  
  92.      +  ISBN  (International  Standard  Book  Number)  and   ISSN
  93.         (International  Standard  Serial Number) entry values are
  94.         examined to verify the checksums of each listed number.
  95.  
  96.      The standardized format of the output  of  bibclean  facili-
  97.      tates  the  later  application  of  simple  filters, such as
  98.      bibextract(1),    bibindex(1),    biblook(1),    bibsort(1),
  99.      citefind(1),  and citetags(1), to process the text, and also
  100.      is the one expected by the GNU Emacs  BibTeX  support  func-
  101.      tions.
  102.  
  103. OPTIONS
  104.      Command-line switches may be abbreviated to a unique leading
  105.      prefix, and letter case is not significant.  All options are
  106.      parsed before any input  bibliography  files  are  read,  no
  107.      matter  what  their order on the command line.  Options that
  108.      correspond to a yes/no setting of a flag have a form with  a
  109.      prefix  "no-"  to set the flag to no.  For such options, the
  110.      last setting determines the flag value used.  This is signi-
  111.      ficant  when  options  are  also specified in initialization
  112.      files (see the INITIALIZATION FILES manual section).
  113.  
  114.      -author                     Display  an  author  credit   on
  115.                                  stderr.  Sometimes an executable
  116.                                  program is  separated  from  its
  117.                                  documentation  and  source code;
  118.                                  this option provides  a  way  to
  119.                                  recover from that.
  120.  
  121.      -error-log filename         Redirect stderr to the indicated
  122.                                  file,  which  will  then contain
  123.                                  all of  the  error  and  warning
  124.                                  messages.   This  option is pro-
  125.                                  vided  for  those  systems  that
  126.  
  127.  
  128.  
  129. Version 2.05      Last change: 17 November 1992                 2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  137.  
  138.  
  139.  
  140.                                  have    difficulty   redirecting
  141.                                  stderr.
  142.  
  143.      -help or -?                 Display  a   help   message   on
  144.                                  stderr,  giving a usage descrip-
  145.                                  tion, similar to this section of
  146.                                  the manual pages.
  147.  
  148.      -init-file filename         Provide an explicit  value  pat-
  149.                                  tern  initialization  file.   It
  150.                                  will  be  processed  after   any
  151.                                  system-wide  and  job-wide  ini-
  152.                                  tialization files found  on  the
  153.                                  PATH  (for  VAX VMS, SYS$SYSTEM)
  154.                                  and  BIBINPUTS   search   paths,
  155.                                  respectively,  and  may override
  156.                                  them.  It in turn may  be  over-
  157.                                  ridden  by  a  subsequent  file-
  158.                                  specific  initialization   file.
  159.                                  The initialization file name can
  160.                                  be changed at compile time,  but
  161.                                  defaults to .bibcleanrc on UNIX,
  162.                                  and to  bibclean.ini  elsewhere.
  163.                                  For  further  details,  see  the
  164.                                  INITIALIZATION FILES manual sec-
  165.                                  tion.
  166.  
  167.      -[no-]check-values          With the  positive  form,  apply
  168.                                  heuristic  pattern  matching  to
  169.                                  value fields in order to  detect
  170.                                  possible  errors  (e.g. ``year =
  171.                                  "192"''  instead  of  ``year   =
  172.                                  "1992"''),  and  issue  warnings
  173.                                  when  unexpected  patterns   are
  174.                                  found.
  175.  
  176.                                  This checking is usually benefi-
  177.                                  cial,  but  if  it  produces too
  178.                                  many bogus warnings for  a  par-
  179.                                  ticular  bibliography  file, you
  180.                                  can disable it with the negative
  181.                                  form  of  this option.  Default:
  182.                                  yes.
  183.  
  184.      -[no-]delete-empty-fields   With the positive  form,  remove
  185.                                  all  key/value  pairs  for which
  186.                                  the value is  an  empty  string.
  187.                                  This  is  helpful in cleaning up
  188.                                  bibliographies  generated   from
  189.                                  text  editor  templates. Compare
  190.                                  this option  with  -[no-]remove-
  191.                                  OPT-prefixes   described  below.
  192.  
  193.  
  194.  
  195. Version 2.05      Last change: 17 November 1992                 3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  203.  
  204.  
  205.  
  206.                                  Default: no.
  207.  
  208.      -[no-]file-position         With  the  positive  form,  give
  209.                                  detailed  file position informa-
  210.                                  tion in warning and  error  mes-
  211.                                  sages.  Default: no.
  212.  
  213.      -[no-]fix-initials          With the positive form, insert a
  214.                                  space  after  a period following
  215.                                  author initials.  Default: yes.
  216.  
  217.      -[no-]fix-names             With the positive form,  reorder
  218.                                  author  and editor name lists to
  219.                                  remove  commas  at  brace  level
  220.                                  zero,  placing  first  names  or
  221.                                  initials  before   last   names.
  222.                                  Default: yes.
  223.  
  224.      -[no-]par-breaks            With the negative form, a  para-
  225.                                  graph  break (either a formfeed,
  226.                                  or  a   line   containing   only
  227.                                  spaces)   is  not  permitted  in
  228.                                  value   strings,   or    between
  229.                                  key/value  pairs.   This  may be
  230.                                  useful to quickly  trap  runaway
  231.                                  strings  arising from mismatched
  232.                                  delimiters.  Default: yes.
  233.  
  234.      -[no-]print-patterns        With the  positive  form,  print
  235.                                  the  value  patterns  read  from
  236.                                  initialization files as they are
  237.                                  added  to  internal tables.  Use
  238.                                  this option to check newly-added
  239.                                  patterns,  or  to  see what pat-
  240.                                  terns are being used.
  241.  
  242.                                  When bibclean is  compiled  with
  243.                                  native   pattern-matching   code
  244.                                  (the  default),  these  patterns
  245.                                  are  the  ones that will be used
  246.                                  in checking  value  strings  for
  247.                                  valid  syntax,  and  all of them
  248.                                  are specified in  initialization
  249.                                  files,  rather  than  hard-coded
  250.                                  into the program.   For  further
  251.                                  details,  see the INITIALIZATION
  252.                                  FILES manual section.   Default:
  253.                                  no.
  254.  
  255.      -[no-]read-init-files       With the negative form, suppress
  256.                                  loading  of  system-, user-, and
  257.                                  file-specific     initialization
  258.  
  259.  
  260.  
  261. Version 2.05      Last change: 17 November 1992                 4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  269.  
  270.  
  271.  
  272.                                  files.    Initializations   will
  273.                                  come  only  from   those   files
  274.                                  explicitly  given  by -init-file
  275.                                  filename options.  Default: yes.
  276.  
  277.      -[no-]remove-OPT-prefixes   With the positive  form,  remove
  278.                                  the ``OPT'' prefix from each key
  279.                                  name  where  the   corresponding
  280.                                  value  is  not  an empty string.
  281.                                  The  prefix  ``OPT''   must   be
  282.                                  entirely  in  upper-case  to  be
  283.                                  recognized.  This option is  for
  284.                                  bibliographies   generated  with
  285.                                  the help of the GNU Emacs BibTeX
  286.                                  editing support, which generates
  287.                                  templates with  optional  fields
  288.                                  identified  by  the ``OPT'' pre-
  289.                                  fix.  Although the function  M-x
  290.                                  bibtex-remove-OPT normally bound
  291.                                  to the keystrokes C-c  C-o  does
  292.                                  the  job,  users  often  forget,
  293.                                  with the result that BibTeX does
  294.                                  not  recognize the key name, and
  295.                                  ignores the value string.   Com-
  296.                                  pare   this  option  with  -[no-
  297.                                  ]delete-empty-fields   described
  298.                                  above.  Default: no.
  299.  
  300.      -[no-]scribe                With the positive  form,  accept
  301.                                  input  syntax  conforming to the
  302.                                  Scribe  document  system.    The
  303.                                  output will be converted to con-
  304.                                  form to BibTeX syntax.  See  the
  305.                                  SCRIBE    BIBLIOGRAPHY    FORMAT
  306.                                  manual   section   for   further
  307.                                  details.  Default: no.
  308.  
  309.      -[no-]trace-file-opening    With the positive form,  log  in
  310.                                  the  error log file the names of
  311.                                  all   files    which    bibclean
  312.                                  attempts   to  open.   Use  this
  313.                                  option to  identify  where  ini-
  314.                                  tialization files are located.
  315.  
  316.      -[no-]warnings              With the  positive  form,  allow
  317.                                  all warning messages.  The nega-
  318.                                  tive  form  is  not  recommended
  319.                                  since  it may mask problems that
  320.                                  should  be  repaired.   Default:
  321.                                  yes.
  322.  
  323.      -version                    Display  the   program   version
  324.  
  325.  
  326.  
  327. Version 2.05      Last change: 17 November 1992                 5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  335.  
  336.  
  337.  
  338.                                  number  on  stderr.   This  will
  339.                                  also include  an  indication  of
  340.                                  who  compiled  the  program, the
  341.                                  host name on which it  was  com-
  342.                                  piled,  the time of compilation,
  343.                                  and the  type  of  string  value
  344.                                  matching   code  selected,  when
  345.                                  that information is available to
  346.                                  the compiler.
  347.  
  348. ERROR RECOVERY AND WARNINGS
  349.      When bibclean detects an error, it issues an  error  message
  350.      to  both  stderr  and stdout.  That way, the user is clearly
  351.      notified, and the output bibliography also contains the mes-
  352.      sage at the point of error.
  353.  
  354.      Error messages begin with a distinctive pair of queries, ??,
  355.      beginning  in  column 1, followed by the input file name and
  356.      line number.  If the -file-position  option  was  specified,
  357.      they  also  contain  the  input  and output positions of the
  358.      current file, entry, and value.  Each position includes  the
  359.      file  byte  number,  the line number, and the column number.
  360.      In the event of a runaway string  argument,  the  entry  and
  361.      value  positions  should  precisely  pinpoint  the erroneous
  362.      bibliography entry, and the  file  positions  will  indicate
  363.      where  it  was  detected,  which  may be rather later in the
  364.      files.
  365.  
  366.      Warning messages identify possible problems, and are  there-
  367.      fore  sent  only to stderr, and not to stdout, so they never
  368.      appear in the output file.  They are identified  by  a  dis-
  369.      tinctive pair of percents, %%, beginning in column 1, and as
  370.      with error messages, may be followed by file  position  mes-
  371.      sages if the -file-position option was specified.
  372.  
  373.      For convenience, the first line of each  error  and  warning
  374.      message  sent to stderr is formatted according to the expec-
  375.      tations of the GNU Emacs next-error command.  You can invoke
  376.      bibclean    with    the   Emacs   M-x   compile<RET>bibclean
  377.      filename.bib >filename.new command, then use the  next-error
  378.      command,  normally  bound to C-x ` (that's a grave, or back,
  379.      accent), to move to the location of the error in  the  input
  380.      file.
  381.  
  382.      If error messages  are  ignored,  and  left  in  the  output
  383.      bibliography  file,  they will precipitate an error when the
  384.      bibliography is next processed with BibTeX.
  385.  
  386.      After issuing an error message, bibclean then resynchronizes
  387.      its  input  by  copying  it  verbatim  to stdout until a new
  388.      bibliography entry is recognized on  a  line  in  which  the
  389.      first  non-blank  character is an at-sign (@).  This ensures
  390.  
  391.  
  392.  
  393. Version 2.05      Last change: 17 November 1992                 6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  401.  
  402.  
  403.  
  404.      that nothing  is  lost  from  the  input  file(s),  allowing
  405.      corrections  to  be  made  in either the input or the output
  406.      files.  However, if bibclean detects an  internal  error  in
  407.      its  data  structures,  it  will  terminate abruptly without
  408.      further input or  output  processing;  this  kind  of  error
  409.      should  never  happen, and if it does, it should be reported
  410.      immediately to the author of the program.   Errors  in  ini-
  411.      tialization  files,  and running out of dynamic memory, will
  412.      also immediately terminate bibclean.
  413.  
  414. INITIALIZATION FILES
  415.      bibclean can be compiled with one of three  different  types
  416.      of  pattern matching; the choice is made by the installer at
  417.      compile time:
  418.  
  419.           +  The original version uses explicit hand-coded  tests
  420.              of value-string syntax.
  421.  
  422.           +  The second version uses regular-expression  pattern-
  423.              matching   host   library   routines  together  with
  424.              regular-expression patterns that come entirely  from
  425.              initialization files.
  426.  
  427.           +  The third version uses special  patterns  that  come
  428.              entirely from initialization files.
  429.  
  430.      The second and third versions are the ones of most  interest
  431.      here, because they allow the user to control what values are
  432.      considered acceptable.  However,  command-line  options  can
  433.      also  be  specified in initialization files, no matter which
  434.      pattern matching choice was selected.
  435.  
  436.      When bibclean starts, it searches for initialization  files,
  437.      finding  the  first  one  in  the  system executable program
  438.      search path (on UNIX and IBM PC DOS, PATH) and the first one
  439.      in  the  BIBINPUTS  search path, and processes them in turn.
  440.      Then, when command-line arguments are processed,  any  addi-
  441.      tional  files  specified  by  -init-filefilename options are
  442.      also processed.   Finally,  immediately  before  each  named
  443.      bibliography  file  is processed, an attempt is made to pro-
  444.      cess an initialization file with the same name, but with the
  445.      extension changed to .ini.  This scheme permits system-wide,
  446.      user-wide, session-wide,  and  file-specific  initialization
  447.      files to be supported.
  448.  
  449.      When input is taken from stdin, there  is  no  file-specific
  450.      initialization.
  451.  
  452.      For precise control, the  -no-init-files  option  suppresses
  453.      all  initialization  files  except those explicitly named by
  454.      -init-filefilename options, either on the command  line,  or
  455.      in requested initialization files.
  456.  
  457.  
  458.  
  459. Version 2.05      Last change: 17 November 1992                 7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  467.  
  468.  
  469.  
  470.      Recursive execution  of  initialization  files  with  nested
  471.      -init-file  options is permitted; if the recursion is circu-
  472.      lar, bibclean will finally get  a  non-fatal  initialization
  473.      file  open  failure after opening too many files.  This ter-
  474.      minates further  initialization  file  processing.   As  the
  475.      recursion  unwinds, the files are all closed, then execution
  476.      proceeds normally.
  477.  
  478.      An initialization file may  contain  empty  lines,  comments
  479.      from  percent  to  end  of  line  (just  like  TeX),  option
  480.      switches, and  key/pattern  or  key/pattern/message  assign-
  481.      ments.   Leading  and  trailing spaces are ignored.  This is
  482.      best illustrated by a short example:
  483.  
  484.      % This is a small bibclean initialization file
  485.  
  486.      -init-file /u/math/bib/.bibcleanrc %% departmental patterns
  487.  
  488.      chapter = "\"D\""                 %% 23
  489.  
  490.      pages   = "\"D--D\""              %% 23--27
  491.  
  492.      volume  = "\"D \\an\\d D\""       %% 11 and 12
  493.  
  494.      year    = \
  495.         "\"dddd, dddd, dddd\"" \
  496.         "Multiple years specified."      %% 1989, 1990, 1991
  497.  
  498.      -no-fix-names   %% do not modify author/editor lists
  499.  
  500.      Long logical lines can be split into multiple physical lines
  501.      by  breaking  at  a  backslash-newline  pair; the backslash-
  502.      newline pair is discarded.  This  processing  happens  while
  503.      characters are being read, before any further interpretation
  504.      of the input stream.
  505.  
  506.      Each logical line must contain a complete  option  (and  its
  507.      value,  if  any),  or  a  complete  key/pattern  pair,  or a
  508.      key/pattern/message triple.
  509.  
  510.      Comments are stripped during the parsing of  the  key,  pat-
  511.      tern,  and  message values.  The comment start symbol is not
  512.      recognized inside quoted strings, so it can be  freely  used
  513.      in such strings.
  514.  
  515.      Comments on logical lines that were input as multiple physi-
  516.      cal  lines  via the backslash-newline convention must appear
  517.      on the last physical line; otherwise, the remaining physical
  518.      lines will become part of the comment.
  519.  
  520.      Pattern strings must be enclosed in quotation marks;  within
  521.      such strings, a backslash starts an escape mechanism that is
  522.  
  523.  
  524.  
  525. Version 2.05      Last change: 17 November 1992                 8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  533.  
  534.  
  535.  
  536.      commonly used  in  UNIX  software.   The  recognized  escape
  537.      sequences are:
  538.  
  539.           \a   alarm bell (octal 007)
  540.  
  541.           \b   backspace (octal 010)
  542.  
  543.           \f   formfeed (octal 014)
  544.  
  545.           \n   newline (octal 012)
  546.  
  547.           \r   carriage return (octal 015)
  548.  
  549.           \t   horizontal tab (octal 011)
  550.  
  551.           \v   vertical tab (octal 013)
  552.  
  553.           \ooo character number octal ooo (e.g \012 is linefeed)
  554.  
  555.           \0xhh
  556.                character number hexadecimal hh  (e.g.   \0x0a  is
  557.                linefeed) \0Xhh is character number hexadecimal hh
  558.                (e.g.  \0X0A is linefeed)
  559.  
  560.      Backslash followed by any other character produces just that
  561.      character.   Thus,  \%  gets a literal percent into a string
  562.      (preventing its interpretation as a comment), \" produces  a
  563.      quotation mark, and \\ produces a single backslash.
  564.  
  565.      Use of an ASCII NUL (\0) in a string will terminate it; this
  566.      is a feature of the C programming language in which bibclean
  567.      is implemented.
  568.  
  569.      Key/pattern pairs can be separated by arbitrary  space,  and
  570.      optionally,  either  an  equals  or  colon functioning as an
  571.      assignment operator.  Thus, the following are equivalent:
  572.  
  573.      pages="\"D--D\""
  574.      pages:"\"D--D\""
  575.      pages "\"D--D\""
  576.        pages = "\"D--D\""
  577.        pages : "\"D--D\""
  578.      pages   "\"D--D\""
  579.  
  580.      Each key name can have an arbitrary number of patterns asso-
  581.      ciated  with it; however, they must be specified in separate
  582.      key/pattern assignments.
  583.  
  584.      An empty pattern string  causes  previously-loaded  patterns
  585.      for  that key name to be forgotten.  This feature permits an
  586.      initialization file to completely discard patterns from ear-
  587.      lier initialization files.
  588.  
  589.  
  590.  
  591. Version 2.05      Last change: 17 November 1992                 9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  599.  
  600.  
  601.  
  602.      Patterns  for  value  strings  are  represented  in  a  tiny
  603.      special-purpose  language  that is both convenient and suit-
  604.      able for bibliography value string syntax  checking.   While
  605.      not  as  powerful as the language of regular-expression pat-
  606.      terns, its parsing can be portably implemented in less  than
  607.      3%  of  the  code in a widely-used regular-expression parser
  608.      (the GNU regexp package).
  609.  
  610.      The patterns are represented by the following special  char-
  611.      acters:
  612.  
  613.           <space>  one or more spaces
  614.  
  615.           a        exactly one letter
  616.  
  617.           A        one or more letters
  618.  
  619.           d        exactly one digit
  620.  
  621.           D        one or more digits
  622.  
  623.           w        exactly one word  (one  or  more  letters  and
  624.                    digits)
  625.  
  626.           W        one or more space-separated  words,  beginning
  627.                    and ending with a word
  628.  
  629.           .        one `special' character, one of the characters
  630.                    <space>!#()*+,-./:;?[]~,  a subset of punctua-
  631.                    tion characters that  are  typically  used  in
  632.                    string values
  633.  
  634.           :        one or more `special' characters
  635.  
  636.           X        one or more `special'-separated words,  begin-
  637.                    ning and ending with a word
  638.  
  639.           \x       exactly one x (x is any  character),  possibly
  640.                    with  an  escape sequence interpretation given
  641.                    earlier
  642.  
  643.           x        exactly the character x (x is anything but one
  644.                    of these pattern characters: aAdDwW.:<space>\)
  645.  
  646.      The X pattern character  is  very  powerful,  but  generally
  647.      inadvisable,  since  it will match almost anything likely to
  648.      be found in a BibTeX value string.  The reason for providing
  649.      pattern matching on the value strings is to uncover possible
  650.      errors, not mask them.
  651.  
  652.      There is no provision for specifying ranges  or  repetitions
  653.      of  characters,  but  this can usually be done with separate
  654.  
  655.  
  656.  
  657. Version 2.05      Last change: 17 November 1992                10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  665.  
  666.  
  667.  
  668.      patterns.  It is a good idea to accompany the pattern with a
  669.      comment  showing  the kind of thing it is expected to match.
  670.      Here is a portion of an initialization file giving a few  of
  671.      the patterns used to match number value strings:
  672.  
  673.      number  =       "\"D\""         %% 23
  674.      number  =       "\"A AD\""      %% PN LPS5001
  675.      number  =       "\"A D(D)\""    %% RJ 34(49)
  676.      number  =       "\"A D\""       %% XNSS 288811
  677.      number  =       "\"A D\\.D\""   %% Version 3.20
  678.      number  =       "\"A-A-D-D\""   %% UMIAC-TR-89-11
  679.      number  =       "\"A-A-D\""     %% CS-TR-2189
  680.      number  =       "\"A-A-D\\.D\"" %% CS-TR-21.7
  681.  
  682.      For a bibliography that contains only article entries,  this
  683.      list  should  probably be reduced to just the first pattern,
  684.      so that  anything  other  than  a  digit  string  fails  the
  685.      pattern-match   test.    This  is  easily  done  by  keeping
  686.      bibliography-specific patterns in a corresponding file  with
  687.      extension .ini, since that file is read automatically.
  688.  
  689.      You should be sure to use empty pattern strings in this pat-
  690.      tern  file  to  discard patterns from earlier initialization
  691.      files.
  692.  
  693.      The value strings passed to the pattern matcher contain sur-
  694.      rounding  quotes, so the patterns should also.  However, you
  695.      could use a pattern specification like  "\"D"  to  match  an
  696.      initial digit string followed by anything else; the omission
  697.      of the final quotation mark \" in  the  pattern  allows  the
  698.      match to succeed without checking that the next character in
  699.      the value string is a quotation mark.
  700.  
  701.      Because the value strings are intended to  be  processed  by
  702.      TeX,  the  pattern  matching ignores braces, and TeX control
  703.      sequences, together with any space following  those  control
  704.      sequences.  Space around braces are preserved.  This conven-
  705.      tion allows the pattern fragment A-AD-D to match  the  value
  706.      string  TN-K\slash 27-70,  because  the  value is implicitly
  707.      collapsed to TN-K27-70 during the matching operation.
  708.  
  709.      bibclean's normal action when a string value fails to  match
  710.      any of the corresponding patterns is to issue a warning mes-
  711.      sage something like this:  "Unexpected  value  in  ``year  =
  712.      "192"''.   In  most  cases,  that is sufficient to alert the
  713.      user to a problem.  In some cases, however, it may be desir-
  714.      able to associate a different message with a particular pat-
  715.      tern.  This can be done by supplying a message  string  fol-
  716.      lowing  the  pattern  string.   Format items %% (single per-
  717.      cent), %e (entry name), %k (key name),  %t  (citation  tag),
  718.      and  %v  (string  value) are available to get current values
  719.      expanded in the messages.  Here is an example:
  720.  
  721.  
  722.  
  723. Version 2.05      Last change: 17 November 1992                11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  731.  
  732.  
  733.  
  734.      chapter = "\"D:D\"" "Colon found in ``%k = %v''" %% 23:2
  735.  
  736.      To be consistent with other messages output by bibclean, the
  737.      message string should not end with punctuation.
  738.  
  739.      If you wish to make the message an error, rather than just a
  740.      warning, begin it with a query (?), like this:
  741.  
  742.      chapter = "\"D:D\"" "?Colon found in ``%k = %v''" %% 23:2
  743.  
  744.      The query will not be included in the output message.
  745.  
  746.      Escape sequences are supported in message strings,  just  as
  747.      they  are in pattern strings.  You can use this to advantage
  748.      for fancy things, such as terminal display mode control.  If
  749.      you rewrite the previous example as
  750.  
  751.      chapter = "\"D:D\"" \
  752.                "?\033[7mColon found in ``%k = %v''\033[0m" %% 23:2
  753.  
  754.      the error message will appear in inverse  video  on  display
  755.      screens  that support ANSI terminal control sequences.  Such
  756.      practice is not normally  recommended,  since  it  may  have
  757.      undesirable  effects  on some output devices.  Nevertheless,
  758.      you may find it useful for restricted applications.
  759.  
  760.      For some  types  of  bibliography  keys,  bibclean  contains
  761.      special-purpose  code  to  supplement or replace the pattern
  762.      matching:
  763.  
  764.           +  ISBN and ISSN fields are handled  this  way  because
  765.              their  validation  requires  evaluation of checksums
  766.              that cannot be expressed by simple patterns; no pat-
  767.              terns are even used in these two cases.
  768.  
  769.           +  When bibclean is compiled with pattern-matching code
  770.              support,  chapter,  number, pages, and volume values
  771.              are checked only by pattern matching.
  772.  
  773.           +  month values are first checked against the  standard
  774.              BibTeX  month abbreviations, and only if no match is
  775.              found are patterns then used.
  776.  
  777.           +  year values are first checked against patterns, then
  778.              if no match is found, the year numbers are found and
  779.              converted to integer values for testing against rea-
  780.              sonable bounds.
  781.  
  782.      Values for other keywords are checked only against patterns.
  783.      You can provide patterns for any keyword you like, even ones
  784.      bibclean does not already know about.  New ones  are  simply
  785.      added  to an internal table that is searched for each string
  786.  
  787.  
  788.  
  789. Version 2.05      Last change: 17 November 1992                12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  797.  
  798.  
  799.  
  800.      to be validated.
  801.  
  802.      The special keyword, tag, represents the bibliographic cita-
  803.      tion tag.  It can be given patterns, like any other keyword.
  804.      Here is an initialization file pattern assignment that  will
  805.      match  an  author name, a colon, an alphabetic string, and a
  806.      two-digit year:
  807.  
  808.      tag = "A:Add"                     %% Knuth:TB86
  809.  
  810.      Notice that no quotation marks are included in the  pattern,
  811.      because  the citation tags are not quoted.  You can use such
  812.      patterns to help  enforce  uniform  naming  conventions  for
  813.      citation  tags,  which  is  increasingly  important  as your
  814.      bibliography data base grows.
  815.  
  816. SCRIBE BIBLIOGRAPHY FORMAT
  817.      bibclean's support for the  Scribe  bibliography  format  is
  818.      based  on  the syntax description in the Scribe Introductory
  819.      User's Manual, 3rd Edition, May 1980.  Scribe was originally
  820.      developed  by  Brian Reid at Carnegie-Mellon University, and
  821.      is now marketed by Unilogic, Ltd.
  822.  
  823.      The BibTeX bibliography format was  strongly  influenced  by
  824.      Scribe,  and  indeed,  with  care,  it  is possible to share
  825.      bibliography files between the two  systems.   Nevertheless,
  826.      there are some differences, so here is a summary of features
  827.      of the Scribe bibliography file format:
  828.  
  829.      (1)   Letter case is not significant in keywords  and  entry
  830.            names, but case is preserved in value strings.
  831.  
  832.      (2)   In key/value pairs, the key and value may be separated
  833.            by one of three characters: =, /, or space.  Space may
  834.            optionally surround these separators.
  835.  
  836.      (3)   Value delimiters are any of these seven pairs: { }   [
  837.            ]   ( )   < >   ' '   " "   ` `
  838.  
  839.      (4)   Value delimiters may not be nested, even  though  with
  840.            the first four delimiter pairs, nested balanced delim-
  841.            iters would be unambiguous.
  842.  
  843.      (5)   Delimiters can be omitted around values  that  contain
  844.            only letters, digits, sharp (#), ampersand (&), period
  845.            (.), and percent (%).
  846.  
  847.      (6)   Outside of delimited values, a literal at-sign (@)  is
  848.            represented by doubled at-signs (@@).
  849.  
  850.      (7)   Bibliography entries begin with @name, as for  BibTeX,
  851.            but  any of the seven Scribe value delimiter pairs may
  852.  
  853.  
  854.  
  855. Version 2.05      Last change: 17 November 1992                13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  863.  
  864.  
  865.  
  866.            be used to surround the values in key/value pairs.  As
  867.            in (4), nested delimiters are forbidden.
  868.  
  869.      (8)   Arbitrary space may separate entry names from the fol-
  870.            lowing delimiters.
  871.  
  872.      (9)   @Comment is a special command whose delimited value is
  873.            discarded.   As  in (4), nested delimiters are forbid-
  874.            den.
  875.  
  876.      (10)  The special form
  877.  
  878.  
  879.            @Begin{comment}
  880.             ...
  881.            @End{comment}
  882.  
  883.            permits encapsulating arbitrary  text  containing  any
  884.            characters      or      delimiters,     other     than
  885.            ``@End{comment}''.  Any of the seven  delimiter  pairs
  886.            may  be used around the word ``comment'' following the
  887.            ``@Begin'' or ``@End'';  the  delimiters  in  the  two
  888.            cases   need   not  be  the  same,  and  consequently,
  889.            ``@Begin{comment}''/``@End{comment}'' pairs may not be
  890.            nested.
  891.  
  892.      (11)  The key  keyword  is  required  in  each  bibliography
  893.            entry.
  894.  
  895.      (12)  A backslashed quote in a string will be assumed to  be
  896.            a  TeX  accent,  and braced appropriately.  While such
  897.            accents do not conform to Scribe syntax, Scribe-format
  898.            bibliographies  have  been  found  that  appear  to be
  899.            intended for TeX processing.
  900.  
  901.      Because of this loose syntax, bibclean's normal error detec-
  902.      tion heuristics are less effective, and consequently, Scribe
  903.      mode input  is  not  the  default;  it  must  be  explicitly
  904.      requested.
  905.  
  906. SEE ALSO
  907.      bibextract(1),  bibindex(1),  biblook(1),  bibsort(1),  bib-
  908.      tex(1),   citefind(1),   citetags(1),  latex(1),  scribe(1),
  909.      tex(1)
  910.  
  911. FILES
  912.      *.bib          BibTeX  and  Scribe  bibliography  data  base
  913.                     files.
  914.  
  915.      *.ini          File-specific initialization files.
  916.  
  917.      .bibcleanrc    UNIX system and user initialization files.
  918.  
  919.  
  920.  
  921. Version 2.05      Last change: 17 November 1992                14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. BIBCLEAN(1)              USER COMMANDS                BIBCLEAN(1)
  929.  
  930.  
  931.  
  932.      bibclean.ini   Non-UNIX  system  and   user   initialization
  933.                     files.
  934.  
  935.      BIBINPUTS      Search path for user initialization files.
  936.  
  937.      PATH           Search path for system  initialization  files
  938.                     on UNIX and IBM PC DOS>
  939.  
  940.      SYS$SYSTEM     Search path for system  initialization  files
  941.                     on VAX VMS.
  942.  
  943. AUTHOR
  944.      Nelson H. F. Beebe
  945.      Center for Scientific Computing
  946.      Department of Mathematics
  947.      University of Utah
  948.      Salt Lake City, UT 84112
  949.      USA
  950.      Tel: +1 801 581 5254
  951.      FAX: +1 801 581 4148
  952.      Email: <beebe@math.utah.edu>
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987. Version 2.05      Last change: 17 November 1992                15
  988.  
  989.  
  990.  
  991.